import Vue from 'vue'
import Vuex from 'vuex'
import employee from './modules/employee'
import duty from './modules/duty'
import login from './modules/login'
import createPersistedState from "vuex-persistedstate";

Vue.use(Vuex)

let plugin = null

const store = new Vuex.Store({
  strict: process.env.NODE_ENV !== 'production',
  plugins: [createPersistedState()],
  modules: {
      employee,
      duty,
      login,
  },
  getters: {
    plugin() {
      return plugin
    }
  },
  mutations: {
    SET_PLUGIN(state, pl) {
      plugin = pl
    }
  }
})

export default store
